<template>
	<view>
		<view class="u-flex u-row-between header">
			<view class="header-box u-flex-col u-flex u-row-center u-col-center">
				<text class="tip">分红金额</text>
				<text class="price">￥{{divAmount}}</text>
			</view>
			<view class="header-box u-flex-col u-flex u-row-center u-col-center">
				<text class="tip">累计分红</text>
				<text class="price">￥{{total_amount}}</text>
			</view>
		</view>
		<view class="info" v-if="info">
			<view class="u-flex ">
				<text>奖金池：{{info.jc_name}}</text>
				<text>（￥{{info.total_amount}}）</text>
			</view>
			<view class="but" @click="gotoLncome">
				查看入账
			</view>
		</view>
		<view class="list">
			<view  class="item u-flex  u-row-between u-col-center" v-for="(item,index) in list">
				<text>{{$u.timeFormat(item.createtime, 'yyyy年mm月')}}</text>
				<text>({{item.num}}份)</text>
				<text>分红金额：￥{{item.total_amount}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				list:[],
				divAmount:0,
				info:'',
				total_amount:0,
			}
		},
		onLoad(e) {
			if(!e){
				uni.navigateBack()
			}
			this.id =e.id
			this.$u.get('shop/api.index/getJcInfo',{id:this.id})
			.then((res) => {
				this.list =res.data.list
				this.divAmount =res.data.divAmount
				this.total_amount =res.data.total_amount
				this.info =res.data.info
			}).catch(res=>{
				
			})
		},
		methods: {
			gotoLncome(){
				uni.navigateTo({
					url:"/pages/member/bonus/Income_log?id="+this.id
				})
			}
		}
	}
</script>

<style lang='scss'>
.header{
	.header-box{
		width: 50%;
		height: 200rpx;
		background-color: #dd6161;
		color: #fff;
		.tip{
			font-size: 22rpx;
		}
		.price{
			margin-top: 20rpx;
			font-size: 40rpx;
			color: #ffeaaf;
			font-weight: bold;
		}
		
	}
}
.info{
	padding: 20rpx;
	background-color: #ebc7c7;
	display: flex;
	justify-content: space-between;
	.but{
		background-color: #f3f4f6;
		border-radius: 8rpx;
		padding: 10rpx 30rpx;
		font-size: 24rpx;
	}
}
.list{
	background-color: #fff;
	.item{
		padding: 20rpx;
	}
}

</style>
